import launch
import launch_ros
from ament_index_python.packages import get_package_share_directory
import os

def generate_launch_description():
    # 获取默认的urdf文件路径
    autopartol_robot_dir = get_package_share_directory('autopartol_robot')
    default_partol_config_dir = os.path.join(autopartol_robot_dir, 'config/partol_params.yaml')
    # 声明urdf目录的参数，方便修改
    action_partol_node = launch_ros.actions.Node(
        package='autopartol_robot',
        executable='partol_node',
        output='screen',
        parameters=[default_partol_config_dir]
    )
    
    action_speaker_node = launch_ros.actions.Node(
        package='autopartol_robot',
        executable='speaker',
        output='screen'
    )
   
    # Create the launch description and populate
    return launch.LaunchDescription([
        action_partol_node,
        action_speaker_node,  
    ]
    )